<?php

namespace App\Http\Service;
use OpenAI\Laravel\Facades\OpenAI;

use App\Http\Service\BaseService;

class ChatgptService  extends BaseService
{
    private $apiKey="sk-80343c1ec74f43bba6a8ad2d01d19068";
    private $baseUrl="https://dashscope.aliyuncs.com/compatible-mode/v1";
    private $model_list=["deepseek-r1-distill-llama-8b"];
    private $application_id="deepseek-r1-distill-llama-8b";
    private $model_state=[
            "current_index"=> 0,
             "usage_counts"=>[
                    "deepseek-r1-distill-llama-8b"=> 50388
                ]

                
            
        ];
    public function __construct()
    {
        parent::__construct();
       
    }
   
    public function GPT_promote($data)
    {

        $result = OpenAI::chat()->create([
            'model' => 'deepseek-r1-distill-llama-8b',
            'messages' => [
                ['role' => 'user', 'content' => 'Hello!'],
            ],
        ]);

        echo $result->choices[0]->message->content; 
    }
    
}
